package bcel.cardcenter.bconnex.recon.application;

import org.apache.log4j.Logger;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

import bcel.cardcenter.bconnex.recon.service.LogPersistenceService;

public class Main {

	private static final Logger logger = Logger.getLogger(Main.class);
	public static void main(String[] args) {
		
		/*
		File file = new File("configure/RECON20131029.txt");
		File outfile = new File("configure/OUTRECON20131029.csv");
		FileReaderService fileReaderService = new FileReaderServiceImp();
		try {
			fileReaderService.fileReader(file);
			List<Entity> entities = fileReaderService.getEntities();
			fileReaderService.fileWriter(entities, outfile);
		} catch (Exception e) {
			e.printStackTrace();
		}
		*/
		try{
			ApplicationContext context = new ClassPathXmlApplicationContext("applicationContext.xml");
			LogPersistenceService logPersistenceService = (LogPersistenceService) context.getBean("logPersistenceService");
			//logPersistenceService
			logPersistenceService.logFileReader();
			logger.debug("Operation is finished");
		}
		catch(Exception ex){
			logger.debug("Exception occur while try to excute main",ex);
		}
		
	}

}
